<html>
	<title>A unit test for drw.SystemUnderTest class</title>
	<head>
		<script type='text/javascript' src='../app/jsUnitCore.js'></script>
		<script type="text/javascript" src="../lib/jsUnitMockTimeout.js"></script>		

		<script type='text/javascript' src='../../jquery.js'></script>
		
<script type='text/javascript' src='../../js/data.js'></script>
<script type='text/javascript' src='../../js/da.js'></script>
<script type='text/javascript' src='../../js/util.js'></script>		
<script type='text/javascript' src='../../js/log.js'></script>		
<script type='text/javascript' src='../../js/query.js'></script>
<script type='text/javascript' src='../../js/actionHelper.js'></script>	
<script type='text/javascript' src='../../js/hnting.js'></script>	
<script type='text/javascript' src='../../js/scaning.js'></script>
<script type='text/javascript' src='../../js/resultScan.js'></script>
<script type='text/javascript' src='../../js/huntMgr.js'></script>
		<script type='text/javascript'>
			function debug_log(msg) {0
				console.log(msg);
			}

			var query;
			
			// �꾩뿭 �ㅼ젙. 
			var em = {};
			em.ahelper = new CActionHelper();
			em.ahelper.initialize();

			em.util = new CUtil();

			em.scaning = new CScaning();
			em.scaning.initialize();
			em.test = {flag:true};
			em.test.resinfoidx = 0;
			em.droid = false;

em.data = {};
em.data.DA_6star_arr = CDA.data_DA_6start_arr;

var castles = [
			{"id":3070,"name":"\ucc9c\uc0c1\uc131","landtype":3,"x":185,"y":53},
			{"id":14798,"name":"\ucc9c\uc911\uc131","landtype":1,"x":184,"y":54},
			{"id":15072,"name":"\ucc9c\ud558\uc131","landtype":4,"x":188,"y":56},
			{"id":15584,"name":"\ucc9c\ud654\uc131","landtype":3,"x":188,"y":50},
			{"id":17169,"name":"\ucc9c\ud669\uc131","landtype":5,"x":184,"y":51},
			{"id":21909,"name":"\ucc9c\uacf5\uc131","landtype":3,"x":182,"y":50},
];

			 var test_da_arr = [
				 {x:185 ,y:49},
				{x:149 ,y:49}, 
				{x:183 ,y:58}, 
				{x:147,y: 63}, 
				{x:155 ,y:67}, 
				 ];
			function setUp() {
				// perform fixture set up

			}

			function tearDown() {
				// clean up
			}

			function testScanActions() {
				// hnt action test 
				
				var result = true;
				var errorcode = 0 ;
				var complete = false;
				
				// 1ro tngod. 
				var scan_param = {
							// att param :  x, y, tr: { s : n , o : n }, success_cb , error_cb
							citnum : 3070,
							x: 185,
							y: 49,
							tr: { s:1},
							success_cb : succ, 
							error_cb :   error,
				};
				
				
				em.scaning.doScan(scan_param);
				
				function succ () {
					result = true;
					complete = true;
				};

				function error(code) {
					result = false;
					errorcode = code;
					complete = true;	
					debug_log("Erro CB is called !!! in test case :" + errorcode);
				}				
				
				// sync call
				assertTrue(result); 
				
			};

		function testScanDAs() {
				// hnt action test 
				
				var result = true;
				var errorcode = 0 ;

				var complete = false;


				var scan_param = {
							// att param :  x, y, tr: { s : n , o : n }, success_cb , error_cb
							citnum : 3070,
							x: 185,
							y: 49,
							tr: { s:1},
							success_cb : succ, 
							error_cb :   error,
				};
				
				
				
				$.each( test_da_arr, function(i, da) {
					scan_param.x = da.x;
					scan_param.y = da.y;
					em.scaning.doScan(scan_param);
							
				});
				
				
				function succ () {
					result = true;
					complete = true;
					console.log('complete !! scan done ' );
				};

				function error(code) {
					result = false;
					errorcode = code;
					complete = true;	
					debug_log("Erro CB is called !!! in test case :" + errorcode);
				}				
				
				// sync call
				assertTrue(result); 
				
			};
			
	/*
			
			function testScanResults() {
					// hnt action test 
					
					var result = true;
					var errorcode = 0 ;
					var complete = false;
					
					// 1ro tngod. 
					var scanres_param = {
								// citinum, x, y , tr : {s:1} , success_cb, error_cb, notify_cb 
								citnum : 3070,
								// x: 185,
								// y: 49,
								// tr: { s:1},
								success_cb : succ, 
								error_cb :   error,
								notify_cb :   noty,							
					};
					
					
					em.resultscan = new CResultScan();
					em.resultscan.initialize();
					
					em.resultscan.doResultScan(scanres_param);
					
					function succ () {
						result = true;
						complete = true;
						// console.log('complete !! result. ',  em.data.DA_6star_arr );
						console.log('complete !! result. ', CDA.data_DA_6start_arr );
					};
	
					function error(code) {
						result = false;
						errorcode = code;
						complete = true;	
						debug_log("Erro CB is called !!! in test case :" + errorcode);
					}				
					
					function noty(msg) {
						console.log(msg);
					}
					// sync call
					assertTrue(result); 
					
				};		*/
		

		</script>
	</head>
	<body/>
</html>